package com.base.cn.platform.os.service.course.agent.settlement;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.course.CourseBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 推广员结算Service
 *
 * @author LIZHIPENG
 * @create 2018-05-14 下午 5:30
 */
@FeignClient(name = CourseBaseService.appName, configuration = FeignAuthConfig.class)
public interface AgentSettlementService extends CourseBaseService {

    /**
     * 查询结算列表(分页)
     * @param currentPage 页码
     * @param params 条件
     * @param agentUserData 是否设置推广员数据（true：是，false：否）
     * @return
     */
    @RequestMapping(contextPath + "/querySettlementListPage")
    Map<String, Object> querySettlementListPage(@RequestParam(value = "currentPage", required = false, defaultValue = "1") int currentPage,
                                                @RequestBody Map<String, Object> params,
                                                @RequestParam("agentUserData") boolean agentUserData);

    /**
     * 根据ID查询结算
     * @param agentSettlementId 结算ID
     * @param agentUserData 是否设置推广员数据（true：是，false：否）
     * @return
     */
    @RequestMapping(contextPath + "/findSettlementById")
    Map<String, Object> findSettlementById(@RequestParam("agentSettlementId") BigDecimal agentSettlementId,
                                           @RequestParam("agentUserData") boolean agentUserData);

    /**
     * 前台用户确认结算
     * @param params 结算条件
     * @param userId 用户ID
     * @return Map<String, Object>
     */
    @RequestMapping(contextPath + "/confirmSettlement")
    Map<String, Object> confirmSettlement(@RequestBody Map<String, Object> params,
                                          @RequestParam("userId") BigDecimal userId);
}
